
const mutations = {
    activeBoardIndex_update(state,data){
        state.activeBoardIndex = data
    },
    list_add(state, data){
        let item = {
            ...state.defBoard,
            ...data
        }
        state.boardList.push(JSON.parse(JSON.stringify(item)));
        if(data.callback && data.hasOwnProperty('callback')){
          data.callback();
        }
    },
    list_remove(state, index){
        state.boardList.splice(index, 1)
      // 默认添加一项
      if (!state.boardList.length) {
        let item = {
          ...state.defBoard
        }
        state.boardList.push(JSON.parse(JSON.stringify(item)))
      }
    },
    screenshot_update(state, { index, screenshot }){
        state.boardList[index].screenshot = screenshot
    },
    signaturePad_option_update(state, { index, data }){
        state.boardList[index].signaturePad.options[data.key] = data.val;
    },
    signaturePad_data_update(state, { index, data }){
        state.boardList[index].signaturePad.data = data
    },
    signaturePad_undoHistory_update(state, { index, data }){        
      state.boardList[index].signaturePad.undoHistory = data;
    },
}
export default mutations;